


*Import the dataset

*Prepare the dataset
drop if  On_Party_t1==.
drop if  Left==1 
drop if LeftParty==1
drop if Transfer==1

 
*For clustering of standard errors and interactions of fixed effects

gen PaDi = (Party*100) * Region 
gen PaEl = (Party*100) * Election
gen PaDiEl = (Party*100) * Region * Election


*Standardize the sponsorship measure
gen NewSpon = . 
replace NewSpon=Sponsorship/2 if Election==1996
replace NewSpon=Sponsorship/4 if Election==1998
replace NewSpon=Sponsorship/4 if Election==2002
replace NewSpon=Sponsorship/4 if Election==2006
replace NewSpon=Sponsorship/3.5 if Election==2010
replace NewSpon=Sponsorship/4 if Election==2013
replace NewSpon=Sponsorship/4 if Election==2017

*Standardize the bills measure
gen NewBills = . 
replace NewBills=Bills/2 if Election==1996
replace NewBills=Bills/4 if Election==1998
replace NewBills=Bills/4 if Election==2002
replace NewBills=Bills/4 if Election==2006
replace NewBills=Bills/3.5 if Election==2010
replace NewBills=Bills/4 if Election==2013
replace NewBills=Bills/4 if Election==2017

*Stadardize bill-making successrate
gen Success = NewBills/NewSpon

*Standardize interpellations
gen NewOI = . 
replace NewOI=OInter/2 if Election==1996
replace NewOI=OInter/4 if Election==1998
replace NewOI=OInter/4 if Election==2002
replace NewOI=OInter/4 if Election==2006
replace NewOI=OInter/3.5 if Election==2010
replace NewOI=OInter/4 if Election==2013
replace NewOI=OInter/4 if Election==2017


gen NewWI = . 
replace NewWI =WInter/2 if Election==1996
replace NewWI =WInter/4 if Election==1998
replace NewWI =WInter/4 if Election==2002
replace NewWI =WInter/4 if Election==2006
replace NewWI =WInter/3.5 if Election==2010
replace NewWI =WInter/4 if Election==2013
replace NewWI =WInter/4 if Election==2017

*Generate a standardized interpellation measure
gen Questions = NewWI+NewOI


*Generate senior legislative positions
gen Senior =.
replace Senior = 1 if Com_Chair==1  | SpeakerVS > 0   
replace Senior =0 if Senior==.

*Generate the "being young" dummy
gen Young = .
replace Young = 1 if Age<=35
replace Young =0 if Age >35

*Generate a joint measure for sitting on councils & delegations
gen CoDe = Councils + Delegations

*Generate a senior party position dummy
gen SeniorP = 1 if ClubChair>1
replace SeniorP=0 if SeniorP==.


*Table 1 estimation. Note that the FE are for the interaction between party and electoral term. SE are clustered at party level.

eststo: reghdfe Committee_M Young P1  Pref_Share Sex College Experience DoubleMandate  , absorb(PaEl) vce(cluster Party)

eststo:reghdfe CoDe Young P1  Pref_Share Sex College Experience DoubleMandate  , absorb(PaEl) vce(cluster Party)

eststo:reghdfe Senior Young P1  Pref_Share Sex College Experience DoubleMandate , absorb(PaEl) vce(cluster Party)

eststo:reghdfe SeniorP Young P1  Pref_Share Sex College Experience DoubleMandate , absorb(PaEl) vce(cluster Party)

eststo:reghdfe Success Young P1  Pref_Share Sex College Experience DoubleMandate  , absorb(PaEl) vce(cluster Party)

eststo:reghdfe Questions Young P1  Pref_Share Sex College Experience DoubleMandate  , absorb(PaEl) vce(cluster Party)

eststo:reghdfe Voting_1 Young P1  Pref_Share Sex College Experience DoubleMandate  , absorb(PaEl) vce(cluster Party)

esttab using table.csv, b(3) se(3)



*Generate safe ballot spots dummy
gen Safe = .
replace Safe = 1 if P2<=PartyMandates_t1
replace Safe = 0 if P2>PartyMandates_t1


eststo: reghdfe On_Party_t1 Young P1  Pref_Share Sex College Experience DoubleMandate, absorb(PaDiEl) vce(cluster PaDi)
eststo: reghdfe Safe Young P1  Pref_Share Sex College Experience DoubleMandate if On_Party_t1==1, absorb(PaDiEl) vce(cluster PaDi)
eststo: reghdfe Elected_t1 Young P1  Pref_Share Sex College Experience DoubleMandate if On_Party_t1==1, absorb(PaDiEl) vce(cluster PaDi)


*ROBUSTNESS

*Table A3
eststo: nbreg Committee_M Young P1  Pref_Share Sex College Experience DoubleMandate  i.PaEl, vce(cluster Party)

eststo: nbreg CoDe Young P1  Pref_Share Sex College Experience DoubleMandate  i.PaEl, vce(cluster Party)

xtset PaEl

eststo:xtlogit Senior Young P1  Pref_Share Sex College Experience DoubleMandate ,fe

eststo:xtlogit SeniorP Young P1  Pref_Share Sex College Experience DoubleMandate ,fe

eststo: nbreg Success Young P1  Pref_Share Sex College Experience DoubleMandate  i.PaEl, vce(cluster Party)

eststo: nbreg Questions Young P1  Pref_Share Sex College Experience DoubleMandate  i.PaEl, vce(cluster Party)

*Table A4

xtset PaDiEl

eststo: xtlogit On_Party_t1 Young P1  Pref_Share Sex College Experience DoubleMandate, fe

eststo: xtlogit Safe Young P1  Pref_Share Sex College Experience DoubleMandate if On_Party_t1==1, fe

eststo: xtlogit Elected_t1 Young P1  Pref_Share Sex College Experience DoubleMandate if On_Party_t1==1, fe






